﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cherry.Agile.Security
{
    /// <summary>
    /// 用户权限信息变化侦听
    /// </summary>
    public static class AuthorizationSyncListener
    {
        /// <summary>
        /// 数据变化事件
        /// </summary>
        public static event EventHandler<AuthorizationChangedEventArgs> Changed;

        /// <summary>
        /// 触发数据变化
        /// </summary>
        /// <param name="type">数据变化类型</param>
        /// <param name="params">参数</param>
        public static void Post(AuthorizationDataType type, params object[] @params)
        {
            if (Changed != null)
            {
                Changed.Invoke(null,new AuthorizationChangedEventArgs(type,@params));
            }
        }
    }
}
